//3. Comparing Titled/Untitled District Characteristics & Trends

		use "master_violence_landtitle_caracteristicas.dta", clear
		
	* Geographic/Socio-Economic Characteristics
	
			loc balance_vars altura areaoficialkm2  dist_coast dist_magdalenariv dist_caucariv discapital  primeriverdens secriverdens tertriverdens  rainfall estado  total_plots_rfmd_1960_85 popdens95 distancia_mercado  share_afpop05 share_indgpop05 
			
			*secriverdens tertriverdens  coca_0_1 oil  gems
			
		foreach var of loc balance_vars {
			label variable `var' `"`=strproper(`"`:variable label `var''"')'"'
		}

		
		
		ren SierraNevadadeSantaMarta_ZRF_cs SNSM_ZRF
		ren area_titul_comunidades_negras_cs title_afro_des_area
		ren hectareas_solicitudes_mineras_cs  mining_titles_area
		ren date_actualizacion_titulos_p_cs title_date_p
					
		lab var pop1843 "Population 1843"
		lab var altura "Altitude (m)"
		lab var areaoficialkm2 "Area (Sq. Kms)"
		lab var presence_encomienda1560  "Encomienda 1560"
		lab var num_encomiendas1560  "Number of Encomiendas 1560"
		lab var coca_0_1 "Coca Crops"
		lab var presence_mines1560 "Gold mines 1560"
		lab var slave_ratio_norm "Slave Ratio (Normalized) 1843"
		lab var estado "State owned land (hm2, 2005)"
		lab var tracts "Church Lots Auctioned"
		lab var ocup_espan "Spanish occupation (1510 - 1561)"
		lab var disbogota "Distance to Bogotá"
		lab var discapital "Distance to Department Capital (Kms.)"
		lab var pob_ind "Indegenous pop. presence (1535 - 1540)"
		lab var totviolencia85 "Total Violence (1985)"
		lab var share_ospina  "Conservative Vote Share 1856"
		lab var share_murillo "Liberal Vote Share 1856"
		lab var share_mosquera  "Independent Vote Share 1856"
		lab var share_afpop05 "Share Afro-Descent Pop. 2005"
		lab var share_indgpop05 "Share Indigenous Pop. 2005"
		lab var primeriverdens "Primary River Density (Mts./Sq. Kms)"
		lab var secriverdens	"Secondary River Density (Mts./Sq. Kms)"
		lab var tertriverdens	"Tertiary River Density (Mts./Sq. Kms)"
		lab var distancia_mercado "Distance to Nearest Market (Kms)"
		lab var conflicto "Land Conflict (1901 - 1931)"
		lab var Violencia_48_a_53 "La Violencia (1948 - 1953)"
		lab var conflictos_1901_1917 "Land Conflict (1901 - 1917)"
		lab var conflictos_1918_1931 "Land Conflict (1918 - 1931)"
			

		/************ BALANCE TABLE ***********/ //[INCLUDE]	
		
		preserve
		
			foreach v of var * {
				local l`v' : variable label `v'
				if `"`l`v''"' == "" {
					local l`v' "`v'"
				}
			}
	
			
			collapse (mean) `balance_vars' any_title, by(coddepto codmpio)
			
			foreach v of var * {
				label var `v' "`l`v''"
			}
					
			loc x=1
			loc y=0
				
			
				loc y=`y' + 1
				
				*loc allvars`i'
						
				foreach var in `balance_vars' {	
												
					qui eststo `var'`i': areg any_title `var'    , r  absorb(coddepto)
								
					loc allvars`i' `allvars`i''  `var'`i'
				}	
									
				
		restore
			
			
			set scheme s1mono

		coefplot (`allvars', mcolor(black) pstyle(p1)), drop(_cons) xline(0) xtitle(Point Estimate)  plotregion(fcolor(white)) graphregion(color(white) margin(l+12 r+5))     ciopts(recast(rcap)) nokey mlabcolor(black) msize(0.5) mlabposition(6) mlabgap(*0.5)/* mlabel("{it:p} = " + string(@pval,"%9.2f"))*/ mlabsize(0.5)   /*legend(order(2 "20km" 4 "40km" 6 "60km" 8 "80km") size(vsmall) rows(1) on)  yscale(range(9)) coeflabels( , labsize(small))*/  title("{bf: Geographic/}" "{bf:Socio-economic}", size(*0.6)) headings(altura = "{bf:Geographic}"  estado = "{bf:Socio-economic}" ) coeflabels(,labsize(small)) name(geographic, replace) xlabel(,labsize(vsmall))
		

		* Historical Characteristics
	
			estimates clear
		
			loc allvars
			
			loc balance_vars   foundation_date  ColStatePresenceIdx TotalCrownEmployees NonMilCrownEmp  ocup_espan royalroaddist presence_mines1560 presence_encomienda1560 pob_ind   slave_ratio_norm   conflictos_1901_1917  conflictos_1918_1931     Violencia_48_a_53 anucraids1971_78  totviolencia85  spatlagguerrsum100_100 
			
			*foundation_date ocup_espan royalroaddist presence_mines1560 presence_encomienda1560 num_encomiendas1560 num_indians1560 pob_ind    pop1843  slave_ratio_norm   conflictos_1901_1917  conflictos_1918_1931     Violencia_48_a_53 anucraids1971_78  totviolencia85  spatlagguerrsum100_100 
			*dist_palenque_1703_1799 date_founded_1525_1694 date_founded_1703_1799  share_ospina share_murillo share_mosquera
					
			*religioso estado d_conflict slave_ratio 
		/************ BALANCE TABLE ***********/ //[INCLUDE]	
		
		preserve
		
			foreach v of var * {
				local l`v' : variable label `v'
				if `"`l`v''"' == "" {
					local l`v' "`v'"
				}
			}
	
		
			collapse (mean) `balance_vars' any_title, by(coddepto codmpio)
			
			foreach v of var * {
				label var `v' "`l`v''"
			}
					
			loc x=1
			loc y=0
				
			
				loc y=`y' + 1
				
				*loc allvars`i'
						
				foreach var in `balance_vars' {	
												
					 eststo `var'`i': areg any_title `var'    , r  absorb(coddepto)
								
					loc allvars`i' `allvars`i''  `var'`i'
				}	
									
				
		restore
			
			
			set scheme s1mono

		coefplot (`allvars', mcolor(black) pstyle(p1)), drop(_cons) xline(0) xtitle(Point Estimate)  plotregion(fcolor(white)) graphregion(color(white) margin(l+12 r+5))     ciopts(recast(rcap)) nokey mlabcolor(black) msize(0.5) mlabposition(6) mlabsize(0.5) mlabgap(*0.5)/* mlabel("{it:p} = " + string(@pval,"%9.2f"))*/    /*legend(order(2 "20km" 4 "40km" 6 "60km" 8 "80km") size(vsmall) rows(1) on)  yscale(range(9)) coeflabels( , labsize(small))*/  yscale(alt)   title("{bf: Historic}", size(*0.6))  headings(foundation_date = "{bf:Colonial}"  conflictos_1901_1917 = "{bf:Violence}" ) name(historic, replace)  coeflabels(,labsize(small)) xlabel(,labsize(vsmall)) 
	
	* Violence (Pre-Reform)
		
		estimates clear
		
		loc allvars
		
		loc balance_vars  guerrillas85 guerrilla_diff fuerza85 auc85   totviolencia85 anucraids1971_78 orgncap2   conflicto  conflictos_1901_1917 conflictos_1918_1931 Violencia_48_a_53
		*FARC_pc95 ELN_pc_95 Guerrilla_pc_95 dist_palenque_1525_1694  date_founded_1525_1694     litrate1918  schoolrate1918  vaccrate1918 
		
	
			/************ BALANCE TABLE ***********/ //[INCLUDE]	
		
		preserve
		
			foreach v of var * {
				local l`v' : variable label `v'
				if `"`l`v''"' == "" {
					local l`v' "`v'"
				}
			}
	
		
			collapse (mean) `balance_vars' any_title, by(coddepto codmpio)
			
			
			foreach v of var * {
				label var `v' "`l`v''"
			}
					
			loc x=1
			loc y=0
				
			
				loc y=`y' + 1
				
				*loc allvars`i'
						
				foreach var in `balance_vars' {	
												
					qui eststo `var'`i': areg any_title `var'    , r  absorb(coddepto)
								
					loc allvars`i' `allvars`i''  `var'`i'
				}	
									
				
		restore
			
			
			set scheme s1mono

		coefplot (`allvars', mcolor(black) pstyle(p1)), drop(_cons) xline(0) xtitle(Point Estimate)  plotregion(fcolor(white)) graphregion(color(white) margin(l+12 r+5))     ciopts(recast(rcap)) nokey mlabcolor(black) msize(0.5) mlabposition(6)  mlabsize(0.5) mlabgap(*0.5)/* mlabel("{it:p} = " + string(@pval,"%9.2f"))*/   /*legend(order(2 "20km" 4 "40km" 6 "60km" 8 "80km") size(vsmall) rows(1) on)  yscale(range(9)) coeflabels(, labsize(small) )*/  title("{bf: Conflict & Violence}", size(*0.6)) name(violence, replace)   coeflabels(,labsize(small)) xlabel(,labsize(vsmall))
		
			graph combine geographic historic , ///
			saving(`"Descriptive_stats.png"', replace)  rows(1) title("")  graphregion(color(white)) altshrink
			
			graph export `"Descriptive_stats.png"', replace
